{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "63a3bd05",
   "metadata": {},
   "outputs": [],
   "source": [
    "path = r\"E:\\pycharm_out\\yufa\\git_test\\ceshi.txt\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "996cc12b",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = (1,2,3,4,5,6,7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "79564980",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(path,'w',encoding='utf8') as w:\n",
    "    w.write(str(data))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "a6acdcdf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'(1, 2, 3, 4, 5, 6, 7)'"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "with open(path,'r',encoding='utf') as r:\n",
    "    a = r.read()\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "c95835e8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1, 2, 3, 4, 5, 6, 7)"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b = eval(a)\n",
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "68629b31",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
